package ptaTest3;

import java.util.*;
class PersonOverride
{
	private String name;
	private boolean gender;
	private int age;
	public PersonOverride(String name, int age, boolean gender)
	{
		this.name=name;
		this.age=age;
		this.gender=gender;
	}
	public PersonOverride()
	{
		this("default",1,true);
	}
	public String toString()
	{
		return name+"-"+age+"-"+gender;
	}
	public boolean equals(PersonOverride p1,PersonOverride p2)
	{
	    if(p1.name==p2.name&&p1.gender==p2.gender&&p1.age==p2.age)
	    {
	       return true;
	    }
	    else 
	    return false;
	}
}
public class Test355 {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		while(in.hasNext())
		{
			int n1=in.nextInt();
			PersonOverride[] pn1=new PersonOverride[n1];
			for(int i=0;i<n1;i++)
			{
				System.out.println(pn1[i]);
			}
			int n2=in.nextInt();
			PersonOverride[] per = new PersonOverride[n2];
			for(int i=0;i<n2;i++)
			{
				PersonOverride p=new PersonOverride(in.next(),in.nextInt(),in.nextBoolean());
				int j=0;
				while(j<i)
				{
					if(per[j].equals(p)){
						n2--;
						break;
					}
					j++;
				}
				if(j==i){
					per[i]=p;
					System.out.println(p.toString());
					i++;
				}
			}		
			System.out.println(n2);
			System.out.println(Arrays.toString(PersonOverride.class.getConstructors()));
			in.close();
			}
	}
}